package com.whut.v_model;

/**
 * @author fuzhenjie
 * 用以返回工程统计的model
 * 22:26 19.7.26
 */
public class ProjectScore {

    /**
     * 工程名称
     */
    private String projectName;
    /**
     * 上一次分数
     */
    private Float point1;
    /**
     * 最近一次的分数
     **/
    private Float point2;
    /**
     * 趋势
     **/
    private String tendency;

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public Float getPoint1() {
        return point1;
    }

    public void setPoint1(Float point1) {
        this.point1 = point1;
    }

    public Float getPoint2() {
        return point2;
    }

    public void setPoint2(Float point2) {
        this.point2 = point2;
    }

    public String getTendency() {
        return tendency;
    }

    public void setTendency() {
        if(this.point1 == null || this.point2 == null){
            this.tendency = "-";
        }else if(point1>point2){
            //means down 下降
            this.tendency = "d";
        }else if (point1<point2){
            //means up 上升
            this.tendency = "u";
        }else if(point1.equals(point2)){
            this.tendency = "=";
        }
    }

    public ProjectScore(String projectName, Float point1, Float point2, String tendency) {
        this.projectName = projectName;
        this.point1 = point1;
        this.point2 = point2;
        this.tendency = tendency;
    }

    public  ProjectScore(){
        super();
    }
}
